//https://codeforces.com/contest/231/submission/279022205
#include <iostream>
#include <algorithm>
#include <map>
#include <string>
#include <vector>
#include <cmath>
using namespace std;
const int N = 2e5 + 10;
using ll = long long;
ll a[N], dp[N];
ll mod = 1e9 + 7;

void solve()
{
    int n, k; cin >> n >> k;
    for (int i = 1; i <= n; i++)
    {
        cin >> a[i];
    }
    sort(a + 1, a + n + 1);
    int l = 1, r = 1;
    ll ans = 0, num = 0;
    ll cur = 0;
    while (l <= n && r <= n)
    {
        while (cur > k)cur -= a[r] - a[l], l++;
        if (r - l + 1 > ans)ans = r - l + 1, num = a[r];
        r++; cur += (a[r] - a[r - 1]) * (r - l);
    }
    cout << ans << " " << num << "\n";
}

int main()
{
    int _ = 1; //cin >> _;
    while (_--)
        solve();

    return 0;
}